package abcy.cloud.blogcommon.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Optional;

@Component
@Slf4j
public class ParamValidateUtil {

    public static boolean isAnyEmpty(Object... values) {
        for(Object value : values) {
            if(!Optional.ofNullable(value).isPresent()) {
                return true;
            }
        }
        return false;
    }

    public static boolean isNotEmpty(Object... object) {
        for(Object value : object) {
            if(Optional.ofNullable(value).isPresent()) {
                return true;
            }
        }
        return false;
    }

    public static boolean isAllEmpty(Object... values) {
        for(Object value : values) {
            if(!Optional.ofNullable(value).isPresent()) {
                return false;
            }
        }
        return true;
    }

    public static boolean isObjectEmpty(Object object) {
        if(!Optional.ofNullable(object).isPresent()) {
            return false;
        }
        return true;
    }
}
